package com.liuzy;

import liuzy.mvc.core.annotation.Inject;
import liuzy.mvc.core.annotation.Service;
import liuzy.mvc.core.jdbc.Page;
import liuzy.mvc.core.jdbc.PageData;

/**
 * 
 * @author liuzy
 * @version 2015年5月13日
 */
@Service
public class MyServiceImpl implements MyService {
	
	@Inject
	private MyMapper mapper;

	@Override
	public boolean login(String username, String password) {
		PageData pageData = mapper.select(username, password, null);
		if (pageData.getCount() == 1) {
			return true;
		}
		return false;
	}

	@Override
	public PageData manager() {
		return mapper.select(new Page());
	}

	@Override
	public int add(String username, String password) {
		return mapper.insert(username, password);
	}

}
